document.addEventListener("plusready",function()
{
    var _BARCODE = 'BLEPlugin',
    B = window.plus.bridge;
    var BLEPlugin = {
            
    		startScanAsync : function(){
//  			var success = typeof successCallback !== 'function' ? null : function(args){
//  				successCallback(args);
//  			},
//  			fail = typeof errorCallback !== 'function' ? null : function(code){
//  				errorCallback(code);
//  			};
    			var success = null,
    			fail = null;
    			
    			var callbackID = B.callbackId(success,fail);
    			return B.exec(_BARCODE,"startScanAsync",[callbackID]);
    		},
    		startSpeedTestAsync : function(){
    			var success = null,
    			fail = null;
    			
    			var callbackID = B.callbackId(success,fail);
    			return B.exec(_BARCODE,"startSpeedTestAsync",[callbackID]);
    		},
    		// 声明同步返回方法
        startPingAsync : function(){            
            var success = null,
    			fail = null;
    			
    			var callbackID = B.callbackId(success,fail);
    			return B.exec(_BARCODE,"startPingAsync",[callbackID]);
        },
        startWifiTestSync : function(){
        		if(dataManager.getUserName()){
        			return B.execSync(_BARCODE, "startWifiTestSync", [true,dataManager.getUserName(),"oasis.h3c.com",plus.navigator.getCookie("https://oasis.h3c.com")]);
        		}else{
        			return B.execSync(_BARCODE, "startWifiTestSync", [false]);
        		}
        },
        startRemoteSync : function(){
        		if(dataManager.getUserName()){
        			return B.execSync(_BARCODE, "startRemoteSync", [true,dataManager.getUserName(),"oasis.h3c.com",plus.navigator.getCookie("https://oasis.h3c.com")]);
        		}else{
        			return B.execSync(_BARCODE, "startRemoteSync", [false]);
        		}
        }
    };
    window.plus.BLEPlugin = BLEPlugin;
},true);
